< previous page page_275 next page >

Page 275
As you can see from the result set, the SELECT_FROM statement returns all the rows in the table. Whether the table contains 10 or 10,000 records, you can get a complete result set with just one SELECT_FROM statement. This is quite handy, but it can also be quite dangerous. If the result of your SELECT_FROM statement contains too many records, you can slow down the network, possibly run out of memory on your local workstation, and eventually lock up your PC. Later in this lesson, you will learn how to use the WHERE clause to limit the size of your view to only those records you need.
To return all the columns from a table, you can list each column in the SELECT statement. This works if you have only a few columns in the table. However, if you have several columns, it can become quite tedious. There is a shortcut. To automatically list all columns in the table in your result set, instead of typing column names, you can type the asterisk (*). The asterisk tells SQL to return all columns in the requested table. The SELECT statement to display all columns of the Author table would look like this:
SELECT * FROM Authors
Enter the preceding SELECT statement into the Visdata SQL window and review the results. Your screen should look like the one in Figure 8.2.
0275-01.jpg
Figure 8.2.
The results of the 
SELECT * query.
Notice that even though you listed no fields in your SELECT statement, all fields were returned in the result set. This is very useful when you want to display a data table but do not know the names of all the columns. As long as you know a valid table name, you can use the SELECT_FROM statement to display the entire table.
The order in which you list columns in the SELECT_FROM statement controls the order in which they are displayed in the result set. Figure 8.3 shows the results of the following SELECT_FROM statement:
SELECT Name, AUID FROM Authors

 
< previous page page_275 next page >

If you like this book, buy it!